{extend name="layout:default" /}

{block name="title"}评教详情{/block}

{block name="content"}
<link href="https://cdn.bootcss.com/layer/2.2/skin/layer.css" rel="stylesheet">
<div class="row">

    <div class="col-xs-12">

        <div class="box">

            <div class="box-header">

                <h3 class="box-title">{$e.title}评教详情-{$teacher.name}老师</h3>
            </div>
            <a href="{:url('/admin/evaluations/logs', ['eid'=>$Request.param.eid])}" class="btn btn-info">返回</a>

            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover">
                    <tbody>
                    <tr>
                        <th>序号</th>
                        <th>干部会员姓名</th>
                        <th>手机号</th>
                        <th>用户名</th>
                        <th>注册时间</th>
                        <th>操作</th>
                    </tr>

                    {volist name="cadre" id="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.cadre.name}</td>
                        <td>{$vo.cadre.mobile}</td>
                        <td>{$vo.cadre.username}</td>
                        <td>{:date('Y-m-d H:i:s',$vo.cadre.cadre_addtime)}</td>
                        <td>
                            <a href="{:url('/admin/evaluations/questions', ['eid'=>$vo.eid, 'teacher_id'=>$teacher.id, 'uid'=>$vo['uid']])}" title="所有题目" class="btn btn-primary">所有题目</a>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>

                </table>
                {$cadre->render()}
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
    </div>
</div>

{/block}

{block name="js"}

<script src="https://cdn.bootcss.com/layer/2.2/layer.js"></script>
<script>

    function status(obj, id) {
        let s = +($(obj).prop("checked"));
        /*if (s == 2) {
            $('input:checkbox').prop('checked', false);
            $(obj).prop('checked', true);
        }*/
        // console.log(s, id);
        layer.confirm('您确定要改变？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post('/admin/evaluations/status', {id:id, status: s}, function (data) {
                if (data.status == 200) {
                    layer.msg(data.message, {icon: 1})
                } else {
                    layer.msg(data.message, {icon: 2})
                }
                setTimeout(function () {
                    window.location.href = window.location;
                }, 200)
            });
        }, function(){
        });


    }
</script>
{/block}